Skip to main content

vectorDotProduct

Type

function

Summary

Returns the vector dot product of two arrays.

Syntax

vectorDotProduct(<firstArray>, <secondArray>)

Description

Use the vectorDotProduct function to compute the vector dot product of two arrays.

The vector dot product is the sum of the pair-wise product of matching keys from each array. It is equivalent to the following:

    put 0 into runningTotal
repeat for each key currentKey in firstArray
add firstArray[currentKey] * secondArray[currentKey] to runningTotal
end repeat

The names of the keys in firstArray must be the same as names of the keys of secondArray.

Parameters

NameTypeDescription

firstArray

array

A single-dimensional array of numbers

secondArray

array

A single-dimensional array of numbers

Examples

put vectorDotProduct(tVector1, tVector2)

glossary: function, array, return

function: sum, matrixMultiply

Compatibility and Support

Introduced

LiveCode 8.1

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?